/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
/**
 *
 * @author bryanfullam
 */
public class Launcher {
    PneumaticDemo Solenoid1 = new PneumaticDemo(1,2);
    PneumaticDemo Solenoid2 = new PneumaticDemo(3,4);
    boolean preloaded, launching, held;
    Joystick Xbox = new Joystick(1);
            
    
    public Launcher()
    {
       
    }//end constructor
    
    void preload()
    {
        if (Xbox.getRawButton(1))
        {
            Solenoid1.togglepiston();
            preloaded = true;
        }

    }//end method preload
    
    void launch()
    {
        if (Xbox.getRawButton(1)&&held)
        {
            Solenoid2.togglepiston();
            launching = true;
        }
    }//end method launch
    
    void retract()
    {
        if (!held)
        {
            Solenoid1.togglepiston();
            Solenoid2.togglepiston();
            preloaded = false;
            launching = false;
        }
    }//end method retract
    
    void unload()
    {
        if (Xbox.getRawButton(2))
        {
            Solenoid1.togglepiston();
            preloaded = false;
        }
    }//end method unload
    
    void displayStatus()
    {
        Solenoid1.displaystatus();
        Solenoid2.displaystatus();
    }
    
}
